package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.NoReadMesBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.INoReadMesView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin on 2017/12/25.
 * 首页未读消息
 */

public class NoReadMesPest {
    private INoReadMesView mesView;

    public NoReadMesPest(INoReadMesView mesView) {
        this.mesView=mesView;
    }

    //未读消息
    public void getNoReadMessage(){
        Map<String,Object> map = new HashMap<>();
        map.put("sid", MyApplication.sid);
        new ApiManager().getNoReadMessage(map, new BaseCallBack<BaseResult<NoReadMesBean>>() {
            @Override
            public void onSuccess(BaseResult<NoReadMesBean> response) {
                mesView.getNoMesView(response.getData());
            }
            @Override
            public void onFailures(String message) {
                mesView.showError(message);
            }
        });
    }
}
